<template>
  <div class="my_div">
    <img :src="Url" alt="一只可爱的狗子">
    <p @click="dog">{{uname}}</p>
  </div>
</template>

<script>
export default {
  props:['Url','uname'],
  methods:{
    dog() {
      // console.log(this.uname);
      this.$emit('dog',this.uname)
    }
  }
}
</script>

<style>
.my_div {
  width: 200px;
  border: 1px solid black;
  text-align: center;
  float: left;
}

.my_div img {
  width: 100%;
  height: 200px;
}
</style>